// publish components to npm
// https://parastudios.de/create-a-react-component-as-npm-module/

/* config-overrides.js */

const path = require('path')
const { override, addWebpackAlias, overrideDevServer } = require('customize-cra')

const devServerConfig = () => config => {
  // config.port = 8000
  //config.proxy = {
  //   '/back': {
  //     target: 'http://192.168.10.169:8080/',
  //     changeOrigin: true,
  //     ws: false,
  //     pathRewrite: {
  //       '^/back': '/back'
  //     },
  //     secure: false,
  //   }
  // }
  return config
}

module.exports = {
  webpack: override(
    addWebpackAlias({
      ['@']: path.resolve(__dirname, "src")
    }),
  ),
  devServer: overrideDevServer(
    devServerConfig()
  )
}
